<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>人员设置 人员设置</title>
<link href="${rc.contextPath}/common/css/common/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${rc.contextPath}/common/js/thickbox/jquery.js"></script>
<script type="text/javascript" src="${rc.contextPath}/common/js/thickbox/thickbox.js"></script>
<link rel="stylesheet" href="${rc.contextPath}/common/js/zTree/css/zTreeStyle/zTreeStyle.css" type="text/css"/>
<script type="text/javascript" src="${rc.contextPath}/common/js/zTree/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="${rc.contextPath}/common/js/zTree/js/jquery.ztree.core-3.5.js"></script>
<script type="text/javascript" src="${rc.contextPath}/common/js/zTree/js/jquery.ztree.excheck-3.5.js"></script>
<script type="text/javascript" src="${rc.contextPath}/common/js/zTree/js/jquery.ztree.exedit-3.5.js"></script>
<script language="javascript" type="text/javascript" src="${rc.contextPath}/common/js/calendar/WdatePicker.js"></script>

<style type="text/css">
	.emp{border:solid 1px gray; width:700px; height:300px;display:none; z-index:101;position:absolute; background-color:#FFFFFF;}
	.emp .title{width:100%;height:20px;line-height:50px; border-top:solid 1px red;background-color:#b60613;top:0px;}
	#greyBackGround{background:#000000;width:100%; display:none; z-index:100; top:0px; left:0px; position:absolute;}

	.deptTree{border:solid 1px gray; width:700px; height:500px;display:none; z-index:101;position:absolute; background-color:#FFFFFF;}
	.deptTree .title{width:100%;height:20px;line-height:50px; border-top:solid 1px red;background-color:#b60613;top:0px;}
	#deptTreeBackGround{background:#000000;width:100%; display:none; z-index:100; top:0px; left:0px; position:absolute;}
</style>
<script type="text/javascript" src="${rc.contextPath}/common/js/main.js"></script>
<script type="text/javascript" src="${rc.contextPath}/common/js/ruleSet/empSet.js"></script>
<script type="text/javascript">
	var zNodes=$deptJson;
</script>
</head>
<body>
<div class="main">
  <div class="position">
	   <div class="p_left">当前位置：规则设定>人员设置</div>
	   <div class="p_right">
	    <dl><dt>姓名：</dt><dd>${currentUser.ename}</dd></dl>
	    <dl><dt>登录时间：</dt><dd><span id="nowDate"></span></dd></dl>
	  </div>
  </div>
  <!--可拖动 上部分-->
  <div class="topBox">
    <div class="mesCheck">
      <div class="title1"><strong>人员设置</strong></div>
      <div class="box2C">
      <table style="float:right">		
      <tr>
	   		<th width="100">
	             </th>
	              <td width="300">
	              	<input type="text" id="timeUp" style="height:19px" size="10" name="timeUp" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" value="$!msgTerm.timeUp"/> 
	              	<img onclick="WdatePicker({el:'timeUp'})" src="${rc.contextPath}/common/js/calendar/skin/datePicker.gif" width="16" height="22"/>
	              	至 
	              	<input type="text" id="timeDown" style="height:19px" size="10" name="timeDown" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" value="$!msgTerm.timeDown"/>
	              	<img onclick="WdatePicker({el:'timeDown'})" src="${rc.contextPath}/common/js/calendar/skin/datePicker.gif" width="16" height="22"/>
	              	<div class="btnOper2 btn_inline"><a href="#" onclick="clearSurplusLimit()" class="btn2"><span>推送上限清空</span></a>&nbsp;&nbsp;&nbsp;</div>
	              </td>
	            </tr>
	  </table>
	  
    <!-- 查询 -->
    #if($shiro.hasPermission("员工条件查询"))
	<div style="padding-left: 10px;"  class="tableForm tab1"><br/>
	<form id="queryForm" action="${rc.contextPath}/ruleSet/employeeSet/getEmpList" method="post">
		<input id="pageNow" name="pageNow" type="hidden" />
	
		员工姓名：
		#if($!ename)
			<input id="empName" name="ename" value="$!ename"/>
		#else
			<input id="empName" name="ename" value="" maxlength="20"/>
		#end
		
	  	联系方式：
	  	#if($!contact)
			<input id="contact" name="contact" value="$!contact"/>
		#else
			<input id="contact" name="contact" value=""/>
		#end
	 	电子邮件：
	 	#if($!contact)
			<input id="mail" name="mail" value="$!mail"/>
		#else
			<input id="mail" name="mail" value=""/>
		#end
	 	角色：
	 	#if($!roleId)
		<select id="roleId" name="roleId" style="width: 130px;">
			<option value="">---请选择---</option>
			#foreach( $role in $roleList)  
				#if($roleId==$role.id)
					<option selected="selected" value="$role.id">$role.name</option>
				#else
					<option value="$role.id">$role.name</option>
				#end
			#end
		</select>
		#else
		<select id="roleId" name="roleId" style="width: 130px;">
	  		<option value="">---请选择---</option>
			#foreach( $role in $roleList)  
			<option value="$role.id">$role.name</option>
			#end
		</select>
		#end
	 	

	 	所属部门：
	 	<input id="queryDeptId" name="deptId" type="hidden" value="$!dept.id"/>
     	<input id="queryTempDeptId" value="$!dept.dname"  readonly="readonly"/>
	 	<a href="javaScript:queryDeptTree();"><img src="${rc.contextPath}/common/images/search.jpg" alt="" width="15px;" height="15px;" /></a>
<!-- 	 	#if($deptId)
	 	<select id="deptId" name="deptId" style="width: 130px;">
	  		<option value="">---请选择---</option>
			#foreach( $dept in $deptList)  
				#if($deptId==$dept.id)
					<option selected="selected" value="$dept.id">$dept.dname</option>
				#else
					<option value="$dept.id">$dept.dname</option>
				#end
			#end
		</select>
	 	#else
	 	<select id="deptId" name="deptId" style="width: 130px;">
	  		<option value="">---请选择---</option>
			#foreach( $dept in $deptList)  
			<option value="$dept.id">$dept.dname</option>
			#end
		</select>
	 	#end -->
		<input id="queryEmp" type="button" value="查询"/>&nbsp; &nbsp; 
		<input id="clean" type="button" value="清空"/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;  &nbsp; &nbsp;     
		</form>
		<div><strong>员工列表</strong></div>
	</div>
	#end
	<!-- 列表 -->
	<div>
		<table class="tab2" cellpadding="0" align="center" width="100%">
		  	<tr align="center" >
		  		<th width="5%"><input id="selectAll" onchange="selectAll()" type="checkbox"></input></th>
		  		<th width="">员工姓名</th>
		  		<th width="">联系方式</th>
		  		<th width="" >电子邮件</th>
		  		<th width="" >所属部门</th>
		  		<th width="" >角色</th>
		  		<th width="" >报备库容量</th>
		  		<th width="" >人工推送上限</th>
		  		<th width="" >剩余推送个数</th>
		  		<th width="" >人工推送下限</th>
		  		<th width="" >是否接收系统推送</th>
		  		<th width="" >是否接收人工调配</th>
		  		<th width="" >是否可接客户</th>
		  		<th width="10%">操作</th>
		  	</tr>
	  		#foreach( $emp in $pageView.records)
		  	<tr align="center" >
		  		<td>
		  		#if($emp.approvalStatus)
		  			#if($emp.approvalStatus!=2)
		  				<input id="empId_$emp.empno" type="checkbox" value="$emp.empno" />
		  			#end
		  		#else
		  			<input id="empId_$emp.empno" type="checkbox" value="$emp.empno" />
		  		#end
		  		</td>
		  		<td>$!emp.ename</td>
		  		<td>$!emp.phone</td>
		  		<td>$!emp.email</td>
		  		<td>#if($emp.dname)$!emp.dname#end</td>
		  		<td>#if($emp.roleName)$!emp.roleName#end</td>
		  		<td>#if($emp.repcustomerCount)$!emp.repcustomerCount#end</td>
		  		<td>#if($emp.customerLimit)$!emp.customerLimit#end</td>
		  		<td>$!emp.surplusLimit</td>
		  		<td>#if($emp.customerLowerLimit)$!emp.customerLowerLimit#end</td>
		  		<td>#if($emp.isSysPush)
		  				#if($emp.isSysPush==1)是#else否#end 
		  			#else否#end
		  		</td>
		  		<td>#if($emp.isArtificialPush)
		  				#if($emp.isArtificialPush==1)是#else否#end 
		  			#else否#end 
		  		</td>	
		  		<td>#if($emp.receiveCustom)
		  				#if($emp.receiveCustom==1)是#else否#end 
		  			#else否#end 
		  		</td>		
		  		<td align="center">
		  		#if($shiro.hasPermission("员工角色修改"))#end
		  			#if($emp.approvalStatus)
		  				#if($emp.approvalStatus==2)
		  					审批中
		  				#elseif($emp.approvalStatus==1)
		  					<a href="javaScript:employeeSet('$!emp.empno','$!emp.repcustomerCount','$!emp.customerLimit','$!emp.customerLowerLimit','$!emp.isSysPush','$!emp.isArtificialPush','$!emp.receiveCustom');" style="text-decoration: underline;">设置<a/>  
		  					(审批通过)
		  				#elseif($emp.approvalStatus==3)
		  					<a href="javaScript:employeeSet('$!emp.empno','$!emp.repcustomerCount','$!emp.customerLimit','$!emp.customerLowerLimit','$!emp.isSysPush','$!emp.isArtificialPush','$!emp.receiveCustom');" style="text-decoration: underline;">设置<a/>  
		  					(审批未通过)
		  				#end
		  			#else
		  				<a href="javaScript:employeeSet('$!emp.empno','$!emp.repcustomerCount','$!emp.customerLimit','$!emp.customerLowerLimit','$!emp.isSysPush','$!emp.isArtificialPush','$!emp.receiveCustom');" style="text-decoration: underline;">设置<a/>  
		  			#end
		  			
		  		</td>
		    </tr>
	    	#end
		</table><br/>
		#if($shiro.hasPermission("批量角色修改"))
			<input id="bathEmployeeSet" type="button" value="批量设置" style="margin-right: 20px;"/>
		#end
	</div>
	<!-- #BeginLibraryItem "/Library/page.lbi" -->
  	#set($pageNow=$pageView.pageNow)
	#set($pageNext=$pageView.pageNow+1)
	#if($pageView.pageNow==1)
		 #set($pageBack=$pageView.pageNow)
	#else
		 #set($pageBack=$pageView.pageNow - 1)
	#end
    #set($startRecord=($pageNow*$pageView.pageSize)-$pageView.pageSize+1)
    #set($endRecord=($pageNow*$pageView.pageSize))
    <input type="hidden" value="${pageView.pageCount}" id="pageCount"/>
    <div class="page clearfix">
      <ul class="le">
	        <li>显示<span>${startRecord}-${endRecord}</span>条</li>
	        <li>共<span>${pageView.rowCount}</span>条</li>
	        <li>第&nbsp;<span>${pageView.pageNow}</span>&nbsp;页</li>
      </ul>
      <ul class="ri">
        <li><a href="javascript:;configPageController('jump')" class="go">&nbsp;</a></li>
        <li>到
          <input type="text" class="input" id="pageJump" size="4" />
          页</li>
        <li><a href="javascript:;configPageController('${pageView.pageCount}')" class="btn">[末页]</a></li>
        <li><a href="javascript:;configPageController('${pageNext}')" class="btn">[下页]</a></li>
        <li><a href="javascript:;configPageController('${pageBack}')" class="btn">[前页]</a></li>
        <li><a href="javascript:;configPageController('1')" class="btn">[首页]</a></li>
      </ul>
    </div>
    <!-- #EndLibraryItem -->
	      		 
	<script>
	//分页
	function configPageController(value) {
		var pageCount=$("#pageCount").val();
		if(value<1){
			value=1;
		}
		if(value=="jump"){
			value=$("#pageJump").val();
		}
		if(parseInt(value)>parseInt(pageCount)){
			value=pageCount;
		}
		if(!$isQuery){
			window.location="${rc.contextPath}/ruleSet/employeeSet/employeeSetPage?pageNow="+value;
		}else{
			$("#pageNow")[0].value=value;
			$("#queryForm").submit();
		}	
	}
	</script>
	<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
	<div id="empSet" class="emp" style="width: 500px;height: 230px;">
	   	<div class="title"></div>
	   	<div style="margin-left: 20px;">人员设置</div>
	   	<div style="margin-left: 20px;">
	   	<form id="updateEmpForm" action="${rc.contextPath}/ruleSet/employeeSet/updateEmp" method="post">
	   		<input id="receiveCustom" type="checkbox" onclick="noPushCheck()"/>&nbsp;是否可接客户	<br/>
	   		<input id="empnoStr" name="empnoStr" type="hidden" />
	   		<input id="empno" name="empno" type="hidden" />
			&nbsp;&nbsp;报备库容量:<input id="repcustomerCount" name="repcustomerCount" type="text" /><br/>
			人工推送上限:<input id="customerLimit" name="customerLimit" type="text" /><br/>
			人工推送下限:<input id="customerLowerLimit" name="customerLowerLimit" type="text" /><br/>
			<input id="sysPush" name="isSysPush" type="hidden" />
			<input id="isSysPush" type="checkbox" />&nbsp;是否接收系统推送&nbsp;&nbsp;&nbsp;
			<input id="artificialPush" name="isArtificialPush" type="hidden" />
			<input id="isArtificialPush" type="checkbox" />&nbsp;是否接收人工推送
			<input type="hidden" id="receiveCustomHidden" name="receiveCustomHidden"/>
			<br/><br/>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input id="cancelBtn" type="button" value="取消" style="float:right;margin-right:20px;"/> 
			<input id="bathConfirmBtn" type="button" value="确认" style="display: none;float:right;margin-right:10px;"/>	
			<input id="confirmBtn" type="button" value="确认" style="float:right;margin-right:10px;"/>	
		</form>
		</div>   
	</div>

	<div id="deptTree" class="deptTree" style="width: 800px;height: 400px;">
		<div class="title"></div><br/>
		<div style="margin-left: 20px;">选择部门
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input id="deptTreeBtnCancel" type="button"  value="取消" style="float: right;margin-right: 10px;"/>
			<input id="queryDeptTreeBtnConfirm" type="button"  value="确定" style="float: right;margin-right: 10px;" />&nbsp;&nbsp;
		</div>
		<div style="margin-left: 20px;overflow-x: auto; overflow-y: auto;float: left;" class="zTreeDemoBackground left" >
			<ul id="treeDemo" class="ztree" style="width: 650px;height: 250px;"></ul>
		</div>
	</div>
</div>
</div>
</div>
</div>
<!-- 提示等待div -->
  <center><div class="div6" id="waitDiv">加载中...</div></center>
</body>
</html>
